package org.xserver.component.core.dispatch.http;

import org.xserver.component.core.XServerHttpContextAttachment;
import org.xserver.component.core.dispatch.AbstractRequestDispatch;
import org.xserver.component.handler.ext.http.HttpResponseWriterHandlerFactory.HttpResponseType;

public abstract class HttpRequestDispatch extends AbstractRequestDispatch {

	/**
	 * It is determined whether the file download request
	 * 
	 * @param attachment
	 * @return
	 */
	public static String getHttpResponseType(
			XServerHttpContextAttachment attachment) {
		String path = attachment.getRequest().getPath();
		if (path.contains(".")) {
			return HttpResponseType.FILE.getType();
		}
		return HttpResponseType.INTERFACE.getType();
	}

}
